<template>
    <div class="layerPublicStyle">
        <lay-form-item label="骑手接单"  class="_row_style" label-width="120">
            <div class="_content">
                <lay-switch v-model="formData.rider_order_get_status"  :disabled="true" onswitch-text="已接单"  unswitch-text="未接单"></lay-switch>
            </div>
        </lay-form-item>
        <lay-form-item label="骑手名称"  class="_row_style" label-width="120">
            <div class="_content">
                <div v-if="formData.rider_order_get_status">
                    {{  formData.rider_id }}
                </div>
                <div>
                    
                </div>
            </div>
        </lay-form-item>
        <lay-form-item label="订单状态"  class="_row_style" label-width="120" >
            <div class="_content">
                {{  enumConverter.order_status_valuetotext[formData.order_status] }}
            </div>
        </lay-form-item>
        <lay-form-item label="订单编号"  class="_row_style" label-width="120">
            <div class="_content">
                {{  formData.order_id }}
            </div>
        </lay-form-item>
        <lay-form-item label="所属学校" class="_row_style" label-width="120">
            <div class="_content">
                {{  formData.school_id[0].text }}
            </div>
        </lay-form-item>
        <lay-form-item label="配送费" class="_row_style" label-width="120">
            <div class="_content">
                {{  +getBigJs(formData.product_list[0].store_food_delivery_fee).div(100) }}元
            </div>
        </lay-form-item>
        <lay-form-item label="打包费" class="_row_style" label-width="120">
            <div class="_content">
                {{  +getBigJs(formData.product_list[0].store_food_pack_fee_format).div(100) }}元
            </div>
        </lay-form-item>
        <lay-form-item label="订单小费" class="_row_style" label-width="120">
            <div class="_content">
                {{  +getBigJs(formData.order_tips_money).div(100) }}元
            </div>
        </lay-form-item>
        <lay-form-item label="订单合计金额" class="_row_style" label-width="120">
            <div class="_content">
                {{  +getBigJs(formData.order_all_money).div(100) }}元
            </div>
        </lay-form-item>
        <lay-form-item label="订单总金额" class="_row_style" label-width="120">
            <div class="_content">
                {{  +getBigJs(formData.order_real_all_money).div(100) }}元
            </div>
        </lay-form-item>
        <lay-form-item label="商品信息" class="_row_style" label-width="120" style="margin-bottom:10px">
            <div class="_no_flex _box_border" style="width:400px">
                <div class="_item_box" v-for="(item,index) in formData.product_list[0].check_result" :key="index">
                    <div class="_title">
                        {{  item.product.product_name }} x {{ item.count }}
                    </div>
                    <div class="_text">
                        {{  item.inventoryShowName.join(`、`) }}
                    </div>
                </div>
            </div>
        </lay-form-item>
        <lay-form-item label="订单备注" class="_row_style" label-width="120" style="margin-bottom:10px">
            <div class="_content _box_border" style="width:400px">
                {{  formData.user_remark }}
            </div>
        </lay-form-item>
        <lay-form-item label="下单时间" class="_row_style" label-width="120">
            <div class="_content">
                {{  getMoment(formData.create_date) }}
            </div>
        </lay-form-item>
        <lay-form-item label="预计送达时间" class="_row_style" label-width="120">
            <div class="_content">
                {{  formData.expected_delivery_text }}
            </div>
        </lay-form-item>
        <lay-form-item label="送达地址" class="_row_style" label-width="120">
            <div class="_content">
                {{  formData.user_address_text }}
            </div>
        </lay-form-item>
    </div>
</template>

<script setup>
import { enumConverter } from '../../js_sdk/validator/food-order-list.js';
import { reactive,nextTick,onMounted,ref} from 'vue'
import BigJs from 'big.js'
import moment from 'moment'
const db = uniCloud.database()

const props = defineProps({
    serverData:Object,
    callback:Function
})

const formData=reactive(props.serverData);

    onMounted(async () => {

    })
    
    function getBigJs(args){
        return new BigJs(args)
    }

    function getMoment(date){
        return moment(date).format(`YYYY-MM-DD HH:mm:ss`)
    }

</script>

<style lang="stylus" scoped>
.layerPublicStyle
    padding 20px
    ._row_style
        margin-bottom 0
</style>


